package fr.afcepf.atod12.afcepfvoyage.beans;
import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name="Transport")
public abstract class Transport extends Offre implements Serializable{
	@Transient
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Long idTransport;
	@Column(length=30)
	private String reference;
	@Column(length=30)
	private String compagnie;
	@Column(length=30)
	private String type ;
	@ManyToMany(fetch=FetchType.LAZY)
	@JoinTable(name="OffreTransport"
		, joinColumns={@JoinColumn(name="idOffre")}
		, inverseJoinColumns={@JoinColumn(name="idTransport")}
		)
	private List<Offre> offres;
	public Transport() {
	}
	public final Long getIdTransport() {
		return idTransport;
	}
	public final void setIdTransport(Long idTransport) {
		this.idTransport = idTransport;
	}
	public final String getReference() {
		return reference;
	}
	public final void setReference(String reference) {
		this.reference = reference;
	}
	public final String getCompagnie() {
		return compagnie;
	}
	public final void setCompagnie(String compagnie) {
		this.compagnie = compagnie;
	}
	public final String getType() {
		return type;
	}
	public final void setType(String type) {
		this.type = type;
	}
	public final List<Offre> getOffres() {
		return offres;
	}
	public final void setOffres(List<Offre> offres) {
		this.offres = offres;
	}
}

